package com.astronomy.qa.mapper;

import com.astronomy.qa.pojo.Problem;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


public interface ProblemMapper extends Mapper<Problem> {
    @Select("SELECT a.* FROM tb_problem a JOIN tb_pl b ON a.id = b.problemid WHERE b.labelid = #{labelid} ORDER BY a.replytime DESC")
    List<Problem> newList(String labelid);
    @Select("SELECT a.* FROM tb_problem a JOIN tb_pl b ON a.id = b.problemid WHERE b.labelid = #{labelid} ORDER BY a.reply DESC")
    List<Problem> hotList(String labelid);
    @Select("SELECT a.* FROM tb_problem a JOIN tb_pl b ON a.id = b.problemid WHERE b.labelid = #{labelid} AND a.reply =0 ORDER BY a.createtime DESC")
    List<Problem> waitList(String labelid);
}
